/*
 * File:   gamemaptest.cpp
 * Author: reinhard, Irvan
 *
 * Created on Mar 11, 2011, 3:09:50 PM
 */

#include <stdlib.h>
#include "gtest/gtest.h"
#include "game.hpp"
#include "gamemaps.hpp"
#include "direction.hpp"


/*
  GameMaps(GameInterface* game);
  Cell* getCellInFrontOff(Cell* cell, Direction dir);
  Field* getField();
  House* getHouse();
  Shop* getShop();
 */

TEST(GameMapTest, All) {
  
  Game* game = new Game("Irvan", "test.gag");
  EXPECT_EQ(game->getMaps()->getField()->getCellAt(2,1),
          game->getMaps()->getCellInFrontOff(
              game->getMaps()->getField()->getCellAt(1,1),
              kRight));

  EXPECT_EQ(game->getMaps()->getHouse()->getCellAt(2,1),
        game->getMaps()->getCellInFrontOff(
            game->getMaps()->getHouse()->getCellAt(1,1),
            kRight));
  EXPECT_EQ(game->getMaps()->getShop()->getCellAt(2,1),
          game->getMaps()->getCellInFrontOff(
              game->getMaps()->getShop()->getCellAt(1,1),
              kRight));

  EXPECT_EQ(game->getMaps()->getField(),
          game->getMaps()->getMapContaining(
              game->getMaps()->getField()->getCellAt(1,1)));
  EXPECT_EQ(game->getMaps()->getHouse(),
        game->getMaps()->getMapContaining(
            game->getMaps()->getHouse()->getCellAt(1,1)));
  EXPECT_EQ(game->getMaps()->getShop(),
      game->getMaps()->getMapContaining(
          game->getMaps()->getShop()->getCellAt(1,1)));

}
